package o;

import android.net.Uri;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.net.MalformedURLException;
import java.net.URL;
import java.security.MessageDigest;
import java.util.Map;

public class ve implements sa {
    @Nullable
    private URL ʻ;
    private int ʼ;
    @Nullable
    private String ˊ;
    @Nullable
    private final String ˋ;
    private final vg ˎ;
    @Nullable
    private final URL ॱ;
    @Nullable
    private volatile byte[] ॱॱ;

    public ve(URL url) {
        this(url, vg.ˊ);
    }

    public ve(String str) {
        this(str, vg.ˊ);
    }

    public ve(URL url, vg vgVar) {
        this.ॱ = (URL) aas.ˎ(url);
        this.ˋ = null;
        this.ˎ = (vg) aas.ˎ(vgVar);
    }

    public ve(String str, vg vgVar) {
        this.ॱ = null;
        this.ˋ = aas.ˏ(str);
        this.ˎ = (vg) aas.ˎ(vgVar);
    }

    public URL ˋ() throws MalformedURLException {
        return ॱ();
    }

    private URL ॱ() throws MalformedURLException {
        if (this.ʻ == null) {
            this.ʻ = new URL(ʽ());
        }
        return this.ʻ;
    }

    public String ˊ() {
        return ʽ();
    }

    private String ʽ() {
        if (TextUtils.isEmpty(this.ˊ)) {
            String str = this.ˋ;
            if (TextUtils.isEmpty(str)) {
                str = ((URL) aas.ˎ(this.ॱ)).toString();
            }
            this.ˊ = Uri.encode(str, "@#&=*+-_.,:!?()/~'%;$");
        }
        return this.ˊ;
    }

    public Map<String, String> ˏ() {
        return this.ˎ.ˏ();
    }

    public String ˎ() {
        return this.ˋ != null ? this.ˋ : ((URL) aas.ˎ(this.ॱ)).toString();
    }

    public String toString() {
        return ˎ();
    }

    public void ॱ(@NonNull MessageDigest messageDigest) {
        messageDigest.update(ᐝ());
    }

    private byte[] ᐝ() {
        if (this.ॱॱ == null) {
            this.ॱॱ = ˎ().getBytes(ˏ);
        }
        return this.ॱॱ;
    }

    public boolean equals(Object obj) {
        if (!(obj instanceof ve)) {
            return false;
        }
        ve veVar = (ve) obj;
        if (ˎ().equals(veVar.ˎ()) && this.ˎ.equals(veVar.ˎ)) {
            return true;
        }
        return false;
    }

    public int hashCode() {
        if (this.ʼ == 0) {
            this.ʼ = ˎ().hashCode();
            this.ʼ = (this.ʼ * 31) + this.ˎ.hashCode();
        }
        return this.ʼ;
    }
}
